Client-side click tracking

ABSTRACT

Methods, systems, and apparatus, including computer programs encoded on a computer storage medium, for performing client-side click tracking. In one aspect, a method includes receiving, by a client, a resource from one or more servers. The resource includes (i) a link, (ii) click tracking code, and (iii) local storage monitoring code. The method includes invoking, by the client, the click tracking code and the local storage monitoring code, detecting, by the invoked click tracking code, a selection of the link, and generating, by the invoked click tracking code, a representation of the selection of the link. The method includes storing, by the invoked click tracking code, the representation of the selection of the link in a local storage on the client, determining, by the invoked local storage monitoring code, to communicate the representation of the selection of the link; and communicating, by the invoked local storage monitoring code, the representation of the selection of the link to the one or more servers.

BACKGROUND

The present specification relates to click tracking.

Web site users can navigate to, or otherwise interact with, web pages byselecting (or “clicking”) links and other controls. Information aboutuser-selected links can be used by web site managers and web hosts togain insight into user behavior.

Various techniques are used to track user clicks. Some systems use weblogs to log click tracking parameters while processing user actions.Other systems use Uniform Resource Locator (URL) redirects to direct auser to an intermediary resource where clicks are logged, beforedirecting the user to his or her intended destination. Other systemsmake AJAX requests to send click tracking information before performingthe user's intended action. Other systems ping a click tracking serverasynchronously by creating a fake Image object with the source set to aclick tracking URL.

SUMMARY

According to one innovative aspect of the subject matter described inthis specification, client side click tracking can be performed bymonitoring the user selection of hyperlinks that include a particularembedded attribute. Monitoring can be performed using JavaScript codewhich, when invoked by a client, registers a handler that listens forthe selection of the hyperlink, that stores information relating to theselection in a queue before performing an action associated with thehyperlink, and that periodically flushes the queue, therebycommunicating the information relating to the selection to a server forprocessing.

Another innovative aspect of the subject matter described in thisspecification, a method includes receiving, by a client, a resource fromone or more servers, where the resource includes (i) a link, (ii) clicktracking code, and (iii) local storage monitoring code, and invoking, bythe client, the click tracking code and the local storage monitoringcode. The method includes detecting, by the invoked click tracking code,a selection of the link, generating, by the invoked click tracking code,a representation of the selection of the link, and storing, by theinvoked click tracking code, the representation of the selection of thelink in a local storage on the client. The method also includesdetermining, by the invoked local storage monitoring code, tocommunicate the representation of the selection of the link, andcommunicating, by the invoked local storage monitoring code, therepresentation of the selection of the link to the one or more servers.

Other embodiments of these aspects include corresponding systems,apparatus, and computer programs, configured to perform the actions ofthe methods, encoded on computer storage devices.

These and other embodiments may each optionally include one or more ofthe following features. For instance, the link is decorated with aclient-side click tracking attribute; the client-side click trackingattribute includes a click tracking Uniform Resource Locator string;detecting a selection of the link includes registering, by the invokedclick tracking code, an event listener to listen for a selection of alink that is decorated with the client-side click tracking attribute;the event listener is a capture-phase event listener; the link isdecorated with a synchronization flag; determining to communicate therepresentation of the selection of the link comprises determining thatthe synchronization flag has a particular value, and communicating therepresentation includes communicating the representation synchronous tostoring the representation of the selection of the link in the localstorage, in response to determining that the synchronization flag has aparticular value; communicating the representation synchronous tostoring the representation of the link in the local storage includescommunicating the representation without waiting a predetermined periodof time after the representation of the link has been stored in thelocal storage; determining to communicate the representation of theselection of the link includes determining that the synchronization flaghas a particular value, and communicating the representation includesdetermining that a predetermined time interval has elapsed, andcommunicating the representation in response to (i) determining that thesynchronization flag has a particular value, and (ii) determining thatthe predetermined time interval has elapsed; the link includes a link toa phone dialer; the link includes a link to an intra-page link; the linkdoes not include a redirect attribute; the method includes receiving, bythe invoked local storage monitoring code, an acknowledgement that therepresentation of the selection of the link has been received by the oneor more servers, then clearing the local storage; the local storageincludes an HTML5 local storage; the representation identifies a UniformResource Identifier (URI) associated with the link, and specifies a timethat the link was selected; and/or communicating the representationincludes building a ping URL that includes the representation, andtransmitting the ping URL to the one or more servers.

Advantageous implementations may include one or more of the followingfeatures. When a user interacts with a resource (e.g., a web page of aweb site), information related to resource usage may be logged andreported asynchronously, without impacting performance of the navigationto the resource. When the user navigates to a different resource (e.g.,a web page of a different website), resource usage information may beprovided synchronously, ensuring that such information is not lost andthat the information may be processed in a timely manner. Informationregarding selections may be preserved in situations in which users mayattempt to navigate away from a resource, or in which an application forpresenting the resource (e.g., a web browser) may crash. A separation ofcode between tracking and reporting resource usage information may bemaintained, potentially simplifying the process of integrating reportingmechanisms.

The details of one or more implementations are set forth in theaccompanying drawings and the description below. Other potentialfeatures and advantages will become apparent from the description, thedrawings, and the claims.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 is a diagram of an example system that may provide link selectioninformation.

FIG. 2 is a flow chart illustrating an example process for detectinglink selection and providing link selection information.

FIGS. 3A-3B are block diagrams of an example system for detecting,storing, and providing link selection information.

FIG. 4 shows an example of a generic computer device and a genericmobile computer device.

Like reference numbers and designations in the various drawings indicatelike elements.

DETAILED DESCRIPTION

FIG. 1 is a diagram of an example system 100 that may provide linkselection information. FIG. 1 also illustrates an example flow of data,shown in states (A) to (E). States (A) to (E) may occur in theillustrated sequence, or they may occur in a sequence that is differentthan in the illustrated sequence. For example, states (B), (C), and (E),may run concurrently in some implementations.

In general, the system 100 may capture various user actions, includingintra-page selections (e.g., via widgets, phone dialers, etc.),navigation to different pages within a web site, and navigation to pagesof external web sites. Information associated with selection events(e.g., link clicks) can be stored locally (e.g., by a web browser), canbe accumulated, and can be provided (e.g., to a web server) periodicallyor upon the occurrence of particular user actions.

To facilitate the handling, tracking, and reporting of selection events,web links can include attributes that indicate whether the links areassociated with web pages or other resources internal to or external toa particular web site. If a link associated with a web page internal tothe web site is clicked by a user, for example, information related tothe link selection may be stored locally by a web browser and may beaccumulated with information associated with other user actions.

Periodically, e.g., based on a timer, the locally stored information maybe provided by the web browser to a web server hosting the web site, orto a web server that tracks selection information. If a link associatedwith a web page external to the web site is clicked by the user, forexample, information related to the link selection and any additionallocally stored user activity information may be provided to the webserver.

Thus, while the user interacts with the web site, information related toweb site usage may be logged and reported asynchronously, withoutimpacting web site performance. As the user navigates to a different website, for example, site usage information may be provided synchronously,ensuring that web site usage information is not lost and that theinformation may be used by web site managers and web hosts in a timelymanner.

User activity information (e.g., link clicks) can be used by web sitemanagers and web hosts, for example, as a factor in designing andproviding web pages to users. For example, links that receive a highnumber of clicks may be prominently placed within a web page. Forsituations in which the systems discussed here collect personalinformation (e.g., user activity) about individuals, the individuals maybe provided with an opportunity to opt in or opt out of programs orfeatures that may collect the personal information. In addition, certaindata may be anonymized in one or more ways before it is stored or used,so that personally identifiable information is removed.

In further detail, the system 100 includes a web server 102 and a clientcomputing device 104 in communication over one or more networks 110. Theclient computing device 104 can receive a resource 112 a, e.g., a webpage, from the web server 102 and can present information associatedwith the resource 112 a to a user via a display device 106, e.g., amonitor displaying a web browser. The user can employ an input device108 such as a keyboard, a mouse, a touch screen or another sort of inputdevice to interact with the resource, and information associated withthe interaction can be provided by the client computing device 104 tothe web server 102 via the networks 110.

The web server 102 may include one or more servers, e.g., a cloudcomputing server, a server farm, or another server arrangement includingone or more processors configured to execute instructions stored by acomputer-readable medium for performing various server operations. Inthe present example, the web server 102 may be configured to host one ormore web sites, to provide web site pages to users, and to receive andprocess information associated with user interactions (e.g., linkclicks, etc.) with web pages.

The client computing device 104 may be a smart phone, a tablet computer,a notebook computer, a laptop computer, a desktop computer or any otherappropriate portable or stationary computing device. The clientcomputing device 104 may include one or more processors configured toexecute instructions stored by a computer-readable medium for performingvarious client operations, such as input/output, communication, dataprocessing, and the like. For example, the client computing device 104can include or communicate with the display device 106, (e.g., amonitor) to present information associated with a web page resource to auser. The user, for example, can employ the input device 108 (e.g., akeyboard, a mouse, a touch screen, etc.) included in or in communicationwith the client computing device 104 to control a selection cursor 114to interact with the web page resource.

The networks 110 connecting the client computing device 104 and the webserver 102 may be wired or wireless, and may include a packet-basednetwork, such as a TCP-IP network. The networks 110 may include a localarea network such as an intranet, a wide area network, the Internet, orany appropriate combination thereof.

Referring to the example data flow, during state (A), the clientcomputing device 104 receives the resource 112 a (e.g., a web page) fromthe web server 102 via the networks 110. For example, a user of theclient computing device 104 may employ a web browser to navigate to aweb page of a web site hosted by the web server 102. The resource 112 acan include a decorated link 120 a augmented with one or more attributesor flags, client-side click tracking code 122 a, and local storagemonitoring code 124 a.

The decorated link 120 a may be specified upon generating the resource112 a, for example, and may include declarative information used toaugment or modify handling of the link. For example, when constructing avisual element such as a widget that shows, hides, expands, or collapsesother page elements, a phone number link, an intra-page link, a linkfrom one page to another within a web site, a link to a page of anexternal web site, or another sort of visual element with which a usermay interact, a developer and/or an automated process can determinewhether or not user interactions with the visual element are to betracked, and which mechanism are to be used for tracking. A web page mayinclude multiple links, for example, each decorated with one or moreattributes to be used by a web browser to implement various clicktracking techniques.

The client-side click tracking code 122 a and the local storagemonitoring code 124 a may include code (e.g., JavaScript) that can beexecuted by a web browser. Upon receiving the resource 112 a, forexample, a web browser executed by the client computing device 104 caninitialize the resource 112 a and can register one or more eventlisteners for the resource 112 a. An event listener may be registeredfor the client-side click tracking code 122 a, for example, and the codemay be run within a corresponding web browser event handler. Inaddition, a timer (e.g., an interval) may be scheduled for the localstorage monitoring code 124 a. Based on the timer, for example, the webbrowser can trigger the local storage monitoring code 124 a to processlocally stored selection event information.

During state (B), the client computing device 104 runs the client-sideclick tracking code 122 a, here shown as client-side click tracking code122 b, associated with the resource 112 a, here shown as resource 112 b.For example, a web browser executed by the client computing device 104can include an event handler that continually monitors for eventstriggered by actions, such as selections, clicks, hovers, swipes, drags,and other user actions while interacting with the resource 112 b (e.g.,a web page).

During state (C), the client computing device 104 detects a selection ofthe decorated link 120 a, here shown as decorated link 120 c, includedin the resource 112 a, here shown as resource 112 c. For example, a usercan employ the input device 108 and the display device 106 of the clientcomputing device 104 to control the selection cursor 114 and to interactwith the resource 112 (e.g., a web page). Upon the user clicking avisual representation such as a control, a link or block of text, animage, a video, or another visual representation of the decorated link120 c, for example, a web browser presenting the web page can detect theclick, and can run the client-side click tracking code 122 a.

In the present example, the client computing device 104 may determinethat information associated with user interactions with the decoratedlink 120 c is to be stored locally. For example, based on one or moreattributes or flags of the decorated link 120 c, a web browser executedby the client computing device 104 may store user activity information132 such as link and timestamp information in local storage 130, e.g.,HTML5 Local Storage. The decorated link 120 c, for example, may be anintra-page link, such as a link for expanding or collapsing a section ofa web page, or for directing a user to a different page section. Asanother example, the decorated link 120 c may be a link to a phonedialer or another such utility. As the user in the present exampleemploys various web page features without attempting to exit the webpage, user activity information may be collected and accumulated in thelocation storage 130.

During state (D), the client computing device 104 runs the local storagemonitoring code 124 a, here shown as local storage monitoring code 124d, associated with the resource 112 a, here shown as resource 112 d. Forexample, the local storage monitoring code 124 d can be triggered by atimer maintained by a web browser executed by the client computingdevice 104. Upon a particular time interval such as a fraction of asecond, a second, two seconds, five seconds, or another appropriate timeinterval, for example, the local storage monitoring code 124 a maymonitor the local storage 130 to identify stored user activityinformation 132.

During state (E), the client computing device 104 communicates the useractivity information 132, here shown as user activity information 132 e,to the web server 102 via the networks 110. For example, informationrelated to user interaction with the decorated link 120 c such as a linkidentifier, a time at which the link was interacted with, an identifierof the client computing device 104 employed by the user, a useridentifier, an interaction type, and/or other user interactioninformation can be provided to the web server 102.

Upon receipt of the user activity information 132 e, for example, theweb server 102 may use the information to perform various processing andlogging operations. For example, timestamps associated with user actionsmay be calibrated to determine correct times and sequences of theactions. User activity information 132 e from the client computingdevice 104 may be logged and used to recreate a user session, forexample. As another example, user activity information 132 e frommultiple client computing devices 104 may be logged and aggregated foruse in identifying activity patterns related to web page and web siteusage.

FIG. 2 is a flow chart illustrating an example process 200 for detectinglink selection and providing link selection information. Briefly, theprocess 200 includes receiving a resource including a decorated link,code for detecting the selection of decorated links, and code formonitoring local storage. The code for detecting the selection ofdecorated links and the code for monitoring local storage are invoked bythe client. Selection of the decorated link is detected, and datareferencing the link selection is stored locally. A determination topurge the local storage is made by the code monitoring local storage,data referencing the link selection is communicated to a server, and thelocal code storage is cleared.

In more detail, when the process 200 begins (202), a resource isreceived (204). Referring to FIG. 1, for example, the client computingdevice 104 can receive the resource 112, e.g., a web page, from the webserver 102 via the networks 110. The resource can include one or morelinks, each decorated with one or more attributes, a first code portionfor detecting selection of the decorated links, and a second codeportion for monitoring local storage. In the present example, theresource 112 includes the decorated link 120, the client-side clicktracking code 122, and the local storage monitoring code 124.

In some implementations, a web page developer may specify whether userinteraction with a link is to be tracked, and may also indicate anappropriate mechanism to be used for tracking. For example, thedeveloper of a web page may assign an enumerated value to a particularlink included on the web page, indicating a preferred click trackingoption such as “none”, “redirection”, “client-side asynchronoustracking”, “client-side synchronous tracking”, and other suitabletracking options.

In the present example, a post processor, e.g., executed by the webserver 102, can process the web page, considering tracking mechanismsapplicable to the assigned option and/or the client runtime environment.For example, the post processor can compare a destination UniformResource Locator (URL) of a web link against a whitelist of web sitesthat may support asynchronous click tracking. As another example, thepost processor can determine whether the client computing device 104supports code, e.g., JavaScript that may be used to facilitate certainforms of click tracking. Upon post processing, for example, the webserver 102 can provide a version of the resource 112, e.g., the webpage, with versions of the decorated link 120, the client-side clicktracking code 122, and/or the local storage monitoring code 124 suitablefor use by the client computing device 104.

In some implementations, a link may be decorated with one or moreclient-side click tracking attributes. In the present example, for aparticular link, the post processor executed by the web server 102 canconsider the click tracking option specified by the web developer andthe capabilities of the client computing device 104 to assign one ormore attributes to the decorated link 120.

For example, links that are identified as being suitable for client-sideclick tracking may be decorated with a click tracking Uniform ResourceLocator string. As another example, links that are identified as beingsuitable for synchronous or asynchronous click-tracking may be decoratedwith a synchronization flag. Such client-side click tracking attributesmay be rendered as HyperText Markup Language (HTML) tags usable byJavaScript code executed on the client computing device 104, forexample.

The first and second code portions are invoked (206) by the client. Forexample, the client computing device 104 can invoke the client-sideclick tracking code 122 and the local storage monitoring code 124. Insome implementations, an event listener can be registered to listen fora selection of a link that is decorated with the client-side clicktracking attribute. For example, a web browser executed by the clientcomputing device 104 can register a click event listener for the capturephase, which may occur before the bubble phase based on JavaScript eventordering. Thus, in the present example, the registered click eventlistener may be triggered before other web browser event listeners areinformed of a particular user action such as a click.

In some implementations, a timer may be configured to periodicallytrigger local storage monitoring code. For example, the timer may beconfigured to wake up at predetermined intervals (e.g., a fraction of asecond, a second, two seconds, five seconds, etc.) and to trigger thelocal storage monitoring code 124. In some implementations, thepredetermined interval may be configurable. For example, an intervalvalue may be provided by the web server 102 to the client computingdevice 104 as a property of the resource 112. Different client devicesand different runtime environments may be provided with differentinterval values, for example, based on capabilities of the devices,network connections and/or runtime environments.

Selection of the decorated link is detected (208) by the first codeportion. For example, a user of the resource 112 (e.g., a web page) canselect (e.g., click) the decorated link 120. In the present example, theweb browser executed by the client computing device 104 can detect theclick event associated with the selection of the decorated link 120 viathe registered event handler and can run the client-side click trackingcode 122.

Data referencing the link and timestamp data are generated and stored(210) in local storage. For example, the client-side click tracking code122 can generate a serialized representation including identifiers andattributes of the decorated link 120 and can store the representationwith a timestamp indicating the time the user clicked the link. Therepresentation, for example, may include a Uniform Resource Identifier(URI) associated with the link. The representation and timestamp can bestored as user activity information 132 in the local storage 130, e.g.,HTML5 local storage, for example, along with a value indicating that thestored information is related to client-side click tracking.

In the present example, as additional user interactions with theresource 112 are detected, additional information associated with theinteractions can be added to the local storage 130 as user activityinformation 132. For example, additional link representations andtimestamps can be appended to existing representations and timestamps toform a comma-separated list. By storing user activity information, suchas information related to click events, as it occurs, the informationmay be preserved in situations in which a user attempts to navigate awayfrom a web page or web site, or in which a web browser may crash, forexample. If a web browser were to crash during the user's session, forexample, user activity information 132 stored in local storage 130 maypersist, and may be eventually provided to the web server 102 upon theuser re-launching the web browser and returning to a web site associatedwith the resource 112.

Purging of the local storage is determined (212) by the second codeportion, and data referencing the link and timestamp is communicated(214) to the server. For example, the local storage monitoring code 124and/or the client-side click tracking code 122 of the resource 112 candetermine whether and when to purge the local storage 130. In someimplementations, communicating the representation of the link selectionto one or more servers may include purging the representation. Forexample, the client computing device 104 may communicate the useractivity information 132 to the web server 102 and may purge theinformation from the local storage 130.

In some implementations, communicating the representation of the linkselection and purging of the local storage may be based at least in parton the value of a synchronization flag associated with the link. Forexample, if the decorated link 120 is associated with an attributeindicating client-side click tracking and with a flag indicatingasynchronous communication of user activity information, communicatingthe representation and purging the local storage may be based ondetermining that a predetermined timer has elapsed. For example, a timerassociated with a web browser can periodically trigger the local storagemonitoring code 124 to communicate user activity information 132, e.g.,link representations and timestamps, stored in local storage 130 to theweb server 102. Upon providing the user activity information 132, forexample, the local storage 130 may be purged.

However, if the decorated link 120 a is associated with a client-sideclick tracking attribute and with a flag indicating synchronouscommunication of user activity information, for example, communicatingthe representation may be performed synchronously to storing therepresentation of the selection of the link in the local storage. Forexample, upon the user clicking the decorated link 120, the client-sideclick tracking code 122 may determine that the link is associated withan attribute indicating client-side click tracking and with a flagindicating synchronous communication of user activity information. Inthe present example, the client-side click tracking code 122 can add arepresentation and timestamp associated with the decorated link 120 tothe local storage 130 and can communicate the user activity information132 to the web server 102 without waiting a predetermined period of timeafter the representation of the link has been stored in the localstorage.

In some implementations, communicating the representation may includebuilding a ping URL that includes the representation, and transmittingthe ping URL to the one or more servers. For example, to provide theuser activity information 132 to the web server 102, an event handler ofa web browser executed by the client computing device 104 may add aclient ping time to the information, e.g., at the start of a string, mayURI encode the information, and may issue an AJAX request to the webserver 102.

In some implementations, a ping URL format may include the followingformat:

-   -   /m/url?sa=T&atype=i&ctyp=csct&cad={cad}

In the above format, “cad” represents one or more serialized events inthe following format:

-   -   clientPingTime, eventTime:cturl, eventTime:cturl[ . . . ]

In the above format, “cturl” represents the click tracking URL, that is,the URL which is being click tracked.

Pings to the server may be synchronous or asynchronous. Synchronouspings, for example, may send user activity information associated withthe last triggered event, i.e., an event for which synchronous handlingis appropriate, and locally stored user activity information associatedwith any other events that may have preceded the event. Asynchronouspings, for example, may be triggered by a timer, and may send locallystored user activity information associated with events that may havepreceded the elapsing of the timer's time interval.

By reporting some user interactions asynchronously and somesynchronously, for example, user activity (e.g., clicks) may beappropriately reported within the context of a user's actions. Forexample, intra-page or intra-site interactions, e.g., interacting withcontrols which expand/collapse web page sections, navigating todifferent sections within a web page, navigating to different web pageswithin a web site, and other interactions can be accumulated and can beperiodically reported in an asynchronous manner, without impacting webpage performance. Intra-site interactions, e.g., a user navigating toanother site, can be reported synchronously, for example, to ensure thatuser activity information is reported before the user exits a web site.

Local storage is cleared (216) by the second code portion, therebyending (218) the process 200. For example, the local storage monitoringcode 124 can clear the user activity information 132 from the localstorage 130 upon providing the information 132 to the web server 102. Insome implementations, the invoked local storage monitoring code mayreceive an acknowledgement that the representation of the selection ofthe link has been received by the one or more servers, then may clearthe local storage.

For example, after receiving the user activity information 132 from theclient computing device 104, the web server 102 can provide anacknowledgement of the receipt of the information 132 to the clientcomputing device 104. Upon receiving the acknowledgement, for example,the local storage monitoring code 124 can purge the local storage 130 ofthe user activity information 132. Thus, in the present example, thesystem 100 can ensure the successful transfer of information related touser interactions with the resource 112.

FIGS. 3A-3B are block diagrams of an example system 300 for detecting,storing, and providing link selection information. FIGS. 3A-3B alsoillustrates an example flow of data, shown in states (T₀) to (T₈).States (T₀) to (T₈) may occur in the illustrated sequence, or they mayoccur in a sequence that is different than in the illustrated sequence.

Referring to FIG. 3A, the system 300 includes a client 302. The client302 may be a portable or stationary client computing device (e.g., theclient computing device 104, shown in FIG. 1), and may include one ormore processors configured to execute instructions stored by acomputer-readable medium for performing various client operations, suchas input/output, communication, data processing, and the like. Theclient 302 in the present example includes a browser instance 304, e.g.,an instance of a web browser, a network interface 306, a code engine308, a clock 310, and local storage 312.

The browser instance 304, for example, may be an instance of a webbrowser configured to be executed by the client 302 and/or may be acommercially available web browser. The browser instance 304 can includean invoked click tracking code instance 314, an invoked local storagemonitoring code instance 316, and a user interface 318. The invokedclick tracking code instance 316, for example, may be configured todetect selections (e.g., clicks) of links included in the user interface318, to generate representations of the selections, and to store therepresentations in the local storage 312. The invoked local storagemonitoring code instance 316, for example, may be configured to monitorthe local storage 312 based on a timer interval periodically triggeredby the clock 310. The user interface 318, for example, may include oneor more links or controls, e.g., a submit control 330, that may bedecorated with one or more attributes to facilitate click tracking.

The network interface 306 can provide communications capabilities forproviding data to and receiving data from other computing devices,including computing servers (e.g., the web server 102, shown in FIG. 1)and including other clients over one or more networks (e.g., thenetworks 110, also shown in FIG. 1). For example, the network interface306 may employ various communication protocols to receive data, e.g.,HTML, JavaScript code, or other suitable data for rendering by thebrowser instance 304 for presentation to a user via the user interface318. The network interface 306 may also provide information associatedwith user interactions with the user interface 318 to the web server102, for example.

The code engine 308 can be used by the browser instance 304 to runbrowser code, and to run code (e.g., JavaScript) associated withparticular web pages. For example, the invoked click tracking codeinstance 314 and the invoked local storage monitoring code instance 316may be associated with JavaScript code that is triggered by one or moreevent handlers 320. When triggered, for example, such JavaScript codemay be run by the code engine 308.

The clock 310 can be a system clock of the client 302. For example, theclock 310 can measure system time as it transpires. Information providedby the clock 310 may be used by timer event handlers associated with thebrowser instance 304 to detect the passage of time intervals, forexample, and may be used to associate user activity events (e.g.,clicks) with particular times (e.g., timestamps).

The local storage 312 can be used by the browser instance 304, forexample, to store information associated with selections of linksincluded in the user interface 318. In some implementations, the localstorage 312 may include HTML5 local storage. For example, the localstorage 312 may store key/value pairs including information associatedwith selected links, and timestamps of when the selections occurred. Thelocal storage 312 may be associated with a particular web page, forexample, or may be associated with multiple web pages within a web site,and may persist between web browsing sessions. For example, if thebrowser instance 304 were to terminate, e.g., upon closing by a user orupon crashing, the local storage 312 may persist on the client 302 andmay be accessible by the web page/site when the user returns.

Referring to the example data flow, during state (T₀), the invoked clicktracking code instance 314 is registered with the event handlers 320 inassociation with a listen for attribute handler 322. In the presentexample, the listen for attribute handler 322 can be associated with acapture-phase event listener which listens for selections of links andother controls (e.g., the submit control 330) that are decorated with aclient-side click tracking attribute. During state (T₁), a user canemploy a selection cursor 332 to interact with the user interface 318and to select the submit control 330. For example, the user may employ auser input device (e.g., a keyboard, a mouse, a touch screen, etc.) toclick the submit control 330 to submit data entered on web form to a webserver.

During state (T₂), the listen for attribute handler 322 detectsselection, e.g., the user click, of the submit control 330. In thepresent example, the invoked click tracking code instance 314 triggeredby the handler 322 can generate a representation, e.g., a representationincluding a Uniform Resource Identifier, of the selection, and can storethe representation with associated information, including timestampinformation that specifies the time of the selection. During state (T₃),the handler 322 receives the current time from the clock 310, andgenerates a timestamp for when the submit control 330 was clicked by theuser. The handler 322, for example, can serialize and concatenate therepresentation and timestamp information. During state (T₄), therepresentation and timestamp information are stored in local storage312. For example, the representation and timestamp informationassociated with the click of the submit control 330 can be appended toinformation associated with preceding events.

Referring to FIG. 3B, during state (T₅), a timer event associated withthe clock 310 triggers the invoked local storage monitoring codeinstance 316. For example, a predetermined time interval (e.g., afraction of a second, a second, two seconds, five seconds, etc.) mayhave elapsed, triggering the local storage monitoring code instance 316to determine whether locally stored representations of link selectionsmay be communicated to the server. As another example, the invoked localstorage monitoring code 316 may be triggered without waiting for thetime interval to elapse. For example, if the submit control 330 isassociated with a flag indicating that selection of the control 330 isto be communicated synchronously, the locally stored representation ofthe selection, and any preceding selections that may persist in thelocal storage 312, may be communicated upon storing the representationand timestamp information (e.g., during state (T₄)).

In some implementations, the determination of whether to communicatelocally stored information may be made at regular intervals. Forexample, the local storage monitoring code instance 316 may be triggeredevery five seconds, or some other such interval. In someimplementations, the determination of whether to communicate locallystored information may be based in part user activity. For example, uponstoring the representation and timestamp information, e.g., during state(T₄), an event timer may be reset. Upon the timer elapsing after havingbeen reset, i.e., if the user is inactive for a predetermined timeinterval, the timer may trigger the invoked local storage monitoringcode instance 316.

During state (T₆), the invoked local storage monitoring code 316identifies one or more representations/timestamps of link selections inthe local storage 312. The invoked local storage monitoring code 316,for example, can retrieve the stored representation/timestampinformation from the local storage 312, append a client ping time to theinformation, URI-encode the information, and generate a ping URLincluding the information. During state (T₇), the local storagemonitoring code 316 communicates the retrieved representation/timestampinformation. For example, the local storage monitoring code 316 maycommunicate the information synchronously or asynchronously, depending asynchronization flag that may be attributed to the submit control 330.During state (T8), a packet 340 of information (e.g., the ping URL)including the representation/timestamp information is communicated viathe network interface 306. For example, the packet 340 may be providedto one or more web servers for recreating the user's web browsingsession.

As described in the example above, a separation of code may bemaintained between tracking and reporting user activity information. Forexample, user activity may be tracked on the client 302 using theinvoked click tracking code instance 314, and may be reported to one ormore servers using the invoked local storage monitoring code instance316. Thus, in the present example, if additional or other mechanisms forreporting user activity were to be identified, implementation of suchmechanisms could be readily integrated within the system 300.

FIG. 4 shows an example of a generic computer device 400 and a genericmobile computer device 450, which may be used with the techniquesdescribed here. Computing device 400 is intended to represent variousforms of digital computers, such as laptops, desktops, workstations,personal digital assistants, servers, blade servers, mainframes, andother appropriate computers. Computing device 450 is intended torepresent various forms of mobile devices, such as personal digitalassistants, cellular telephones, smartphones, and other similarcomputing devices. The components shown here, their connections andrelationships, and their functions, are meant to be exemplary only, andare not meant to limit implementations of the inventions describedand/or claimed in this document.

Computing device 400 includes a processor 402, memory 404, a storagedevice 406, a high-speed interface 408 connecting to memory 404 andhigh-speed expansion ports 410, and a low speed interface 412 connectingto low speed bus 414 and storage device 406. Each of the components 402,404, 406, 408, 410, and 412, are interconnected using various busses,and may be mounted on a common motherboard or in other manners asappropriate. The processor 402 may process instructions for executionwithin the computing device 400, including instructions stored in thememory 404 or on the storage device 406 to display graphical informationfor a GUI on an external input/output device, such as display 416coupled to high speed interface 408. In other implementations, multipleprocessors and/or multiple buses may be used, as appropriate, along withmultiple memories and types of memory. Also, multiple computing devices400 may be connected, with each device providing portions of thenecessary operations, e.g., as a server bank, a group of blade servers,or a multi-processor system.

The memory 404 stores information within the computing device 400. Inone implementation, the memory 404 is a volatile memory unit or units.In another implementation, the memory 404 is a non-volatile memory unitor units. The memory 404 may also be another form of computer-readablemedium, such as a magnetic or optical disk.

The storage device 406 is capable of providing mass storage for thecomputing device 400. In one implementation, the storage device 406 maybe or contain a computer-readable medium, such as a floppy disk device,a hard disk device, an optical disk device, or a tape device, a flashmemory or other similar solid state memory device, or an array ofdevices, including devices in a storage area network or otherconfigurations. A computer program product may be tangibly embodied inan information carrier. The computer program product may also containinstructions that, when executed, perform one or more methods, such asthose described above. The information carrier is a computer- ormachine-readable medium, such as the memory 404, the storage device 406,memory on processor 402, or a propagated signal.

The high speed controller 408 manages bandwidth-intensive operations forthe computing device 400, while the low speed controller 412 manageslower bandwidth-intensive operations. Such allocation of functions isexemplary only. In one implementation, the high-speed controller 408 iscoupled to memory 404, display 416, e.g., through a graphics processoror accelerator, and to high-speed expansion ports 410, which may acceptvarious expansion cards (not shown). In the implementation, low-speedcontroller 412 is coupled to storage device 406 and low-speed expansionport 414. The low-speed expansion port, which may include variouscommunication ports (e.g., USB, Bluetooth, Ethernet, wireless Ethernet)may be coupled to one or more input/output devices, such as a keyboard,a pointing device, a scanner, or a networking device such as a switch orrouter, e.g., through a network adapter.

The computing device 400 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as astandard server 420, or multiple times in a group of such servers. Itmay also be implemented as part of a rack server system 424. Inaddition, it may be implemented in a personal computer such as a laptopcomputer 422. Alternatively, components from computing device 400 may becombined with other components in a mobile device (not shown), such asdevice 450. Each of such devices may contain one or more of computingdevice 400, 450, and an entire system may be made up of multiplecomputing devices 400, 450 communicating with each other.

Computing device 450 includes a processor 452, memory 464, aninput/output device such as a display 454, a communication interface466, and a transceiver 468, among other components. The device 450 mayalso be provided with a storage device, such as a microdrive or otherdevice, to provide additional storage. Each of the components 450, 452,464, 454, 466, and 468, are interconnected using various buses, andseveral of the components may be mounted on a common motherboard or inother manners as appropriate.

The processor 452 may execute instructions within the computing device450, including instructions stored in the memory 464. The processor maybe implemented as a chipset of chips that include separate and multipleanalog and digital processors. The processor may provide, for example,for coordination of the other components of the device 450, such ascontrol of user interfaces, applications run by device 450, and wirelesscommunication by device 450.

Processor 452 may communicate with a user through control interface 458and display interface 456 coupled to a display 454. The display 454 maybe, for example, a TFT LCD (Thin-Film-Transistor Liquid Crystal Display)or an OLED (Organic Light Emitting Diode) display, or other appropriatedisplay technology. The display interface 456 may comprise appropriatecircuitry for driving the display 454 to present graphical and otherinformation to a user. The control interface 458 may receive commandsfrom a user and convert them for submission to the processor 452. Inaddition, an external interface 462 may be provide in communication withprocessor 452, so as to enable near area communication of device 450with other devices. External interface 462 may provide, for example, forwired communication in some implementations, or for wirelesscommunication in other implementations, and multiple interfaces may alsobe used.

The memory 464 stores information within the computing device 450. Thememory 464 may be implemented as one or more of a computer-readablemedium or media, a volatile memory unit or units, or a non-volatilememory unit or units. Expansion memory 474 may also be provided andconnected to device 450 through expansion interface 472, which mayinclude, for example, a SIMM (Single In Line Memory Module) cardinterface. Such expansion memory 474 may provide extra storage space fordevice 450, or may also store applications or other information fordevice 450. Specifically, expansion memory 474 may include instructionsto carry out or supplement the processes described above, and mayinclude secure information also. Thus, for example, expansion memory 474may be provide as a security module for device 450, and may beprogrammed with instructions that permit secure use of device 450. Inaddition, secure applications may be provided via the SIMM cards, alongwith additional information, such as placing identifying information onthe SIMM card in a non-hackable manner.

The memory may include, for example, flash memory and/or NVRAM memory,as discussed below. In one implementation, a computer program product istangibly embodied in an information carrier. The computer programproduct contains instructions that, when executed, perform one or moremethods, such as those described above. The information carrier is acomputer- or machine-readable medium, such as the memory 464, expansionmemory 474, memory on processor 452, or a propagated signal that may bereceived, for example, over transceiver 468 or external interface 462.

Device 450 may communicate wirelessly through communication interface466, which may include digital signal processing circuitry wherenecessary. Communication interface 466 may provide for communicationsunder various modes or protocols, such as GSM voice calls, SMS, EMS, orMMS messaging, CDMA, TDMA, PDC, WCDMA, CDMA2000, or GPRS, among others.Such communication may occur, for example, through radio-frequencytransceiver 468. In addition, short-range communication may occur, suchas using a Bluetooth, WiFi, or other such transceiver (not shown). Inaddition, GPS (Global Positioning System) receiver module 470 mayprovide additional navigation- and location-related wireless data todevice 450, which may be used as appropriate by applications running ondevice 450.

Device 450 may also communicate audibly using audio codec 460, which mayreceive spoken information from a user and convert it to usable digitalinformation. Audio codec 460 may likewise generate audible sound for auser, such as through a speaker, e.g., in a handset of device 450. Suchsound may include sound from voice telephone calls, may include recordedsound (e.g., voice messages, music files, etc.) and may also includesound generated by applications operating on device 450.

The computing device 450 may be implemented in a number of differentforms, as shown in the figure. For example, it may be implemented as acellular telephone 480. It may also be implemented as part of asmartphone 482, personal digital assistant, or other similar mobiledevice.

Various implementations of the systems and techniques described here maybe realized in digital electronic circuitry, integrated circuitry,specially designed ASICs (application specific integrated circuits),computer hardware, firmware, software, and/or combinations thereof.These various implementations may include implementation in one or morecomputer programs that are executable and/or interpretable on aprogrammable system including at least one programmable processor, whichmay be special or general purpose, coupled to receive data andinstructions from, and to transmit data and instructions to, a storagesystem, at least one input device, and at least one output device.

These computer programs, also known as programs, software, softwareapplications or code, include machine instructions for a programmableprocessor, and may be implemented in a high-level procedural and/orobject-oriented programming language, and/or in assembly/machinelanguage. As used herein, the terms “machine-readable medium”“computer-readable medium” refers to any computer program product,apparatus and/or device (e.g., magnetic discs, optical disks, memory,Programmable Logic Devices (PLDs)) used to provide machine instructionsand/or data to a programmable processor, including a machine-readablemedium that receives machine instructions as a machine-readable signal.The term “machine-readable signal” refers to any signal used to providemachine instructions and/or data to a programmable processor.

To provide for interaction with a user, the systems and techniquesdescribed here may be implemented on a computer having a display device,e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitorfor displaying information to the user and a keyboard and a pointingdevice (e.g., a mouse or a trackball) by which the user may provideinput to the computer. Other kinds of devices may be used to provide forinteraction with a user as well; for example, feedback provided to theuser may be any form of sensory feedback, e.g., visual feedback,auditory feedback, or tactile feedback; and input from the user may bereceived in any form, including acoustic, speech, or tactile input.

The systems and techniques described here may be implemented in acomputing system that includes a back end component (e.g., as a dataserver), or that includes a middleware component (e.g., an applicationserver), or that includes a front end component, e.g., a client computerhaving a graphical user interface or a Web browser through which a usermay interact with an implementation of the systems and techniquesdescribed here, or any combination of such back end, middleware, orfront end components. The components of the system may be interconnectedby any form or medium of digital data communication (e.g., acommunication network). Examples of communication networks include alocal area network (“LAN”), a wide area network (“WAN”), and theInternet.

The computing system may include clients and servers. A client andserver are generally remote from each other and typically interactthrough a communication network. The relationship of client and serverarises by virtue of computer programs running on the respectivecomputers and having a client-server relationship to each other.

A number of embodiments have been described. Nevertheless, it will beunderstood that various modifications may be made without departing fromthe spirit and scope of the invention. In addition, the logic flowsdepicted in the figures do not require the particular order shown, orsequential order, to achieve desirable results. In addition, other stepsmay be provided, or steps may be eliminated, from the described flows,and other components may be added to, or removed from, the describedsystems. Accordingly, other embodiments are within the scope of thefollowing claims.

What is claimed is:
 1. A computer-implemented method comprising:receiving, by a client, a resource from one or more servers, wherein theresource includes (i) a link, (ii) click tracking code for detecting aselection of the link, and (iii) local storage monitoring code;invoking, by the client, the click tracking code and the local storagemonitoring code; detecting, by the invoked click tracking code, theselection of the link; generating, by the invoked click tracking code, arepresentation of the selection of the link; storing, by the invokedclick tracking code, the representation of the selection of the link ina local storage on the client; determining, by the invoked local storagemonitoring code, to communicate the representation of the selection ofthe link; and communicating, by the invoked local storage monitoringcode, the representation of the selection of the link to the one or moreservers.
 2. The method of claim 1, wherein the link is decorated with aclient-side click tracking attribute.
 3. The method of claim 2, whereinthe client-side click tracking attribute comprises a click trackingUniform Resource Locator string.
 4. The method of claim 2, whereindetecting the selection of the link comprises: registering, by theinvoked click tracking code, an event listener to listen for a selectionof a link that is decorated with the client-side click trackingattribute.
 5. The method of claim 4, wherein the event listener is acapture-phase event listener.
 6. The method of claim 1, wherein the linkis decorated with a synchronization flag.
 7. The method of claim 6,wherein: determining to communicate the representation of the selectionof the link comprises determining that the synchronization flag has aparticular value, and communicating the representation comprisescommunicating the representation synchronous to storing therepresentation of the selection of the link in the local storage, inresponse to determining that the synchronization flag has a particularvalue.
 8. The method of claim 7, wherein communicating therepresentation synchronous to storing the representation of the link inthe local storage comprises communicating the representation withoutwaiting a predetermined period of time after the representation of thelink has been stored in the local storage.
 9. The method of claim 6,wherein: determining to communicate the representation of the selectionof the link comprises determining that the synchronization flag has aparticular value, and communicating the representation comprises:determining that a predetermined time interval has elapsed; andcommunicating the representation in response to (i) determining that thesynchronization flag has a particular value, and (ii) determining thatthe predetermined time interval has elapsed.
 10. The method of claim 1,wherein the link comprises a link to a phone dialer.
 11. The method ofclaim 1, wherein the link comprises a link to an intra-page link. 12.The method of claim 1, wherein the link does not include a redirectattribute.
 13. The method of claim 1, comprising: receiving, by theinvoked local storage monitoring code, an acknowledgement that therepresentation of the selection of the link has been received by the oneor more servers, then clearing the local storage.
 14. The method ofclaim 1, wherein the local storage comprises an HTML5 local storage. 15.The method of claim 1, wherein the representation identifies a UniformResource Identifier (URI) associated with the link, and specifies a timethat the link was selected.
 16. The method of claim 1, whereincommunicating the representation comprises: building a ping URL thatincludes the representation, and transmitting the ping URL to the one ormore servers.
 17. A system comprising: one or more computers and one ormore storage devices storing instructions that are operable, whenexecuted by the one or more computers, to cause the one or morecomputers to perform operations comprising: receiving, by a client, aresource from one or more servers, wherein the resource includes (i) alink, (ii) click tracking code for detecting a selection of the link,and (iii) local storage monitoring code; invoking, by the client, theclick tracking code and the local storage monitoring code; detecting, bythe invoked click tracking code, the selection of the link; generating,by the invoked click tracking code, a representation of the selection ofthe link; storing, by the invoked click tracking code, therepresentation of the selection of the link in a local storage on theclient; determining, by the invoked local storage monitoring code, tocommunicate the representation of the selection of the link; andcommunicating, by the invoked local storage monitoring code, therepresentation of the selection of the link to the one or more servers.18. The system of claim 17, wherein the link is decorated with aclient-side click tracking attribute.
 19. The system of claim 18,wherein the client-side click tracking attribute comprises a clicktracking Uniform Resource Locator string.
 20. The system of claim 18,wherein detecting the selection of the link comprises: registering, bythe invoked click tracking code, an event listener to listen for aselection of a link that is decorated with the client-side clicktracking attribute.
 21. The system of claim 20, wherein the eventlistener is a capture-phase event listener.
 22. The system of claim 17,wherein the link is decorated with a synchronization flag.
 23. Thesystem of claim 22, wherein: determining to communicate therepresentation of the selection of the link comprises determining thatthe synchronization flag has a particular value, and communicating therepresentation comprises communicating the representation synchronous tostoring the representation of the selection of the link in the localstorage, in response to determining that the synchronization flag has aparticular value.
 24. The system of claim 23, wherein communicating therepresentation synchronous to storing the representation of the link inthe local storage comprises communicating the representation withoutwaiting a predetermined period of time after the representation of thelink has been stored in the local storage.
 25. The system of claim 22,wherein: determining to communicate the representation of the selectionof the link comprises determining that the synchronization flag has aparticular value, and communicating the representation comprises:determining that a predetermined time interval has elapsed; andcommunicating the representation in response to (i) determining that thesynchronization flag has a particular value, and (ii) determining thatthe predetermined time interval has elapsed.
 26. The system of claim 17,wherein the link comprises a link to a phone dialer.
 27. The system ofclaim 17, wherein the link comprises a link to an intra-page link. 28.The system of claim 17, wherein the link does not include a redirectattribute.
 29. The system of claim 17, wherein the operations comprise:receiving, by the invoked local storage monitoring code, anacknowledgement that the representation of the selection of the link hasbeen received by the one or more servers, then clearing the localstorage.
 30. The system of claim 17, wherein the local storage comprisesan HTML5 local storage.
 31. The system of claim 17, wherein therepresentation identifies a Uniform Resource Identifier (URI) associatedwith the link, and specifies a time that the link was selected.
 32. Thesystem of claim 17, wherein communicating the representation comprises:building a ping URL that includes the representation, and transmittingthe ping URL to the one or more servers.
 33. A non-transitorycomputer-readable medium storing software comprising instructionsexecutable by one or more computers which, upon such execution, causethe one or more computers to perform operations comprising: receiving,by a client, a resource from one or more servers, wherein the resourceincludes (i) a link, (ii) click tracking code for detecting a selectionof the link, and (iii) local storage monitoring code; invoking, by theclient, the click tracking code and the local storage monitoring code;detecting, by the invoked click tracking code, the selection of thelink; generating, by the invoked click tracking code, a representationof the selection of the link; storing, by the invoked click trackingcode, the representation of the selection of the link in a local storageon the client; determining, by the invoked local storage monitoringcode, to communicate the representation of the selection of the link;and communicating, by the invoked local storage monitoring code, therepresentation of the selection of the link to the one or more servers.34. The medium of claim 33, wherein the link is decorated with aclient-side click tracking attribute.
 35. The medium of claim 34,wherein the client-side click tracking attribute comprises a clicktracking Uniform Resource Locator string.
 36. The medium of claim 34,wherein detecting the selection of the link comprises: registering, bythe invoked click tracking code, an event listener to listen for aselection of a link that is decorated with the client-side clicktracking attribute.
 37. The medium of claim 36, wherein the eventlistener is a capture-phase event listener.
 38. The medium of claim 33,wherein the link is decorated with a synchronization flag.
 39. Themedium of claim 38, wherein: determining to communicate therepresentation of the selection of the link comprises determining thatthe synchronization flag has a particular value, and communicating therepresentation comprises communicating the representation synchronous tostoring the representation of the selection of the link in the localstorage, in response to determining that the synchronization flag has aparticular value.
 40. The medium of claim 39, wherein communicating therepresentation synchronous to storing the representation of the link inthe local storage comprises communicating the representation withoutwaiting a predetermined period of time after the representation of thelink has been stored in the local storage.
 41. The medium of claim 38,wherein: determining to communicate the representation of the selectionof the link comprises determining that the synchronization flag has aparticular value, and communicating the representation comprises:determining that a predetermined time interval has elapsed; andcommunicating the representation in response to (i) determining that thesynchronization flag has a particular value, and (ii) determining thatthe predetermined time interval has elapsed.
 42. The medium of claim 33,wherein the link comprises a link to a phone dialer.
 43. The medium ofclaim 33, wherein the link comprises a link to an intra-page link. 44.The medium of claim 33, wherein the link does not include a redirectattribute.
 45. The medium of claim 33, wherein the operations comprise:receiving, by the invoked local storage monitoring code, anacknowledgement that the representation of the selection of the link hasbeen received by the one or more servers, then clearing the localstorage.
 46. The medium of claim 33, wherein the local storage comprisesan HTML5 local storage.
 47. The medium of claim 33, wherein therepresentation identifies a Uniform Resource Identifier (URI) associatedwith the link, and specifies a time that the link was selected.
 48. Themedium of claim 33, wherein communicating the representation comprises:building a ping URL that includes the representation, and transmittingthe ping URL to the one or more servers.